<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$basic.title}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link href="__LAYUI__/css/layui.css" rel="stylesheet">
    <link href="__LAYUI__/css/ah.css" rel="stylesheet">
</head>
<body>
<div class="wrapper-content">
<div class="ibox">
	<div class="ibox-title"><h3>基本信息</h3>
	</div>
	<div class="ibox-content">
		<form class="layui-form" enctype="multipart/form-data" lay-filter="amData" id="amData" action="{:url('basic/edit')}">
				  <div class="layui-form-item">
					<label class="layui-form-label">应用名称</label>
					<div class="layui-input-block">
					  <input type="text" name="title" placeholder="请输入应用名称" class="layui-input">
					</div>
				  </div>
				   <div class="layui-form-item">
				  <div class="layui-inline">
					<label class="layui-form-label">备案号</label>
					<div class="layui-input-inline">
					  <input type="text" name="icp"  placeholder="请输入icp" class="layui-input">
					</div>
				  </div>
				  <div class="layui-inline">
						<label class="layui-form-label">电话</label>
						<div class="layui-input-inline">
							<input type="text" name="tel"  placeholder="请输入tel" class="layui-input">
						</div>
				      </div>
					</div>
				  <div class="layui-form-item">
					<label class="layui-form-label">验证码</label>
					<div class="layui-input-inline">
					  <input type="checkbox" name="code"  lay-skin="switch" lay-filter="switch" lay-text="ON|OFF">
					</div>
				  </div>
					<div class="layui-form-item">
				        <label class="layui-form-label">地址:</label>
				        <div class="layui-input-block">
				          <input type="tel" name="address" autocomplete="off" class="layui-input">
				        </div>
					</div>
					<div class="layui-form-item">
					  <label class="layui-form-label">关键字</label>
					  <div class="layui-input-block" >
						<input type="text" name="keywords"  placeholder="请输入关键字" class="layui-input">
					  </div>
					</div>
					<div class="layui-form-item">
							<label class="layui-form-label">描述</label>
							<div class="layui-input-block">
							<textarea placeholder="请输入描述内容" class="layui-textarea" name="des"></textarea>
							</div>
					</div>
					<div class="layui-form-item">
							<label class="layui-form-label">扩展</label>
							<div class="layui-input-block">
							<textarea placeholder="请输入Json内容" class="layui-textarea" name="ext"></textarea>
							</div>
					</div>
					<div class="layui-form-item">
							<label class="layui-form-label">公告</label>
							<div class="layui-input-block">
							<textarea placeholder="内容" class="layui-textarea" name="notice"></textarea>
							</div>
					</div>
							<button type="button" class="layui-btn" lay-submit lay-filter="saveData">保存提交</button>
		</form>
	</div>
</div>
</div>
</body>
<script src="__LAYUI__/layui.js"></script>
<script>
	var d_json = {$d_json|raw};
  layui.use(['layer', 'jquery', 'form'], function(){
    var $ = layui.jquery;
    var layer = layui.layer;
    var form = layui.form;
	var xaoam ={
		  tool:function(){
				form.on('submit(saveData)', function(data){
					var action = $(this).parent('form').attr('action');
					var Fdata = new FormData(document.getElementById("amData"));
						if(Fdata.get('code') == 'on'){
							Fdata.append('code', 1);
						}else{
							Fdata.append('code', 0);
						}
					$.ajax({
						url:action,
						data:Fdata,
						dataType:'json',
						type:'POST',
						contentType: false,
						processData: false,
						success:function(res){
							layer.msg(res.msg);
						}
					})
				  return false; 
				});
		  },
	};
	xaoam.tool();
	form.val('amData',d_json);
  });
</script>
</html>
